package com.lzy.huijinjiazu.mvp.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;

import com.gyf.barlibrary.ImmersionBar;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.lzy.huijinjiazu.R;
import com.lzy.huijinjiazu.di.component.DaggerLoginComponent;
import com.lzy.huijinjiazu.di.module.LoginModule;
import com.lzy.huijinjiazu.mvp.contract.LoginContract;
import com.lzy.huijinjiazu.mvp.presenter.LoginPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class LoginActivity extends BaseActivity<LoginPresenter> implements LoginContract.View {


    @BindView(R.id.fl_title)
    FrameLayout mFlTitle;

    @Override
    public void setupActivityComponent(AppComponent appComponent) {
        DaggerLoginComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .loginModule(new LoginModule(this))
                .build()
                .inject(this);
    }

    @Override
    public int initView(Bundle savedInstanceState) {
        return R.layout.activity_login; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(Bundle savedInstanceState) {

    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.setTitleBarMarginTop(this, mFlTitle);
    }

    @OnClick({R.id.tv_login, R.id.tv_forget_pwd, R.id.tv_register, R.id.iv_close})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_login:
                break;
            case R.id.tv_forget_pwd:
                break;
            case R.id.tv_register:
                ArmsUtils.startActivity(RegisterActivity.class);
                break;
            case R.id.iv_close:
                finish();
                break;
        }
    }
}
